package com.coocaa.ops.common.core.base.enums;

/**
 * @author bijiahao
 * @date : 2019/6/12.
 * 资源状态 枚举类
 */
public enum ResourceStatusEnums {
    /**
     * 状态枚举
     */
    ON_LINE(4, "Approved and Launched"),
    OFF_LINE(0, "Offline"),
    DRAFT(2, "Draft"),
    TO_AUDITING(3, "Pending"),
    AUDITED_NOT_PASS(5, "Review Not Passed"),
    AUDITED_NOT_ON_LINE(7, "Approved and not online"),
    FILM_IDS_CHECK_NOT_PASS(8, "Video IDS verification failed"),
    SECOND_TO_AUDITING(9, "Second pending"),
    CAN_USE(1, "Usable"),
    PACKAGE_NAMES_CHECK_NOT_PASS(10, "Package name verification failed"),
    ALL_CHECK_NOT_PASS(11, "Failed verification"),
    URGENT_OFF_LINE(-1, "Emergency removal");

    private final int status;
    private final String desc;

    ResourceStatusEnums(final int status, final String desc) {
        this.status = status;
        this.desc = desc;
    }

    public int getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

    /**
     * 是否验证不通过情况
     *
     * @param status
     * @return
     */
    public static boolean isPanelCheckNotPass(Integer status) {
        return null != status && (FILM_IDS_CHECK_NOT_PASS.getStatus() == status
                || PACKAGE_NAMES_CHECK_NOT_PASS.getStatus() == status
                || ALL_CHECK_NOT_PASS.getStatus() == status);
    }
}
